<?php
 /* @var $blogUserInfo BlogUserInfo */
class blogView extends sfPHPView
{
  public function configure()
  {
    parent::configure();
 
    // Grab the theme from BlogUserInfo constructor.
    $blogUserInfo = BlogUserInfo::getInstance();
 
    // If there is a theme and if the theme feature is enabled
    if($blogUserInfo && sfConfig::get('app_theme'))
    {
        $theme = $blogUserInfo->getBlogInfo()->getCssName();
        if( $theme != '' )
        {
            $this->getContext()->getResponse()->addStylesheet($theme);
            sfContext::getInstance()->getUser()->setCulture($blogUserInfo->getBlogInfo()->getInterfaceLng());
        }
        /* use if templates changes by theme */
      // Look for templates in a $theme/ subdirectory of the usual template location
//      if (is_readable($this->getDirectory().'/'.$blogUserInfo->blogInfo->getCssName.'/'.$this->getTemplate()))
//      {
//        $this->setDirectory($this->getDirectory().'/'.$theme);
//      }
 
      // Look for a layout in a $theme/ subdirectory of the usual layout location
//      if (is_readable($this->getDecoratorDirectory().'/'.$theme.'/'.$this->getDecoratorTemplate()))
//      {
//        $this->setDecoratorDirectory($this->getDecoratorDirectory().'/'.$theme);
//      }
    }
  }
 
}